
if exists(select name from sysobjects where name = 'sp_DiemGetNamHocHocKyByMasv')
	drop proc sp_DiemGetNamHocHocKyByMasv
go
/*
	Created by: Phuoc NH
	Created on: 5/12/2013 (dd/mm/yyyy)
	Description: 
	--

	File:$sql-scripts/Proc.sp_DiemGetNamHocHocKyByMasv.sql
*/

create proc sp_DiemGetNamHocHocKyByMasv
@MaSinhVien varchar(50)
as
begin
	select distinct MaSinhVien, CONVERT(int, SUBSTRING(namhoc,1,4)) as namhoc, HocKy, b.TenMon from bangdiem a inner join Mon b on a.MaMon=b.MaMon where MaSinhVien=@MaSinhVien and TrangThai<>'0' order by namhoc
end

